package com.onlineauction.servlets;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class LogoutAccountServlet extends HttpServlet {
	
	private static final long serialVersionUID = 1932943094210777079L;
	
	@Override
	public void doGet (HttpServletRequest request, HttpServletResponse response) throws IOException,
			ServletException {
		HttpSession session = request.getSession();
		if (session != null) {
			session.invalidate();
		}
		response.sendRedirect("/LoginAccount");
	}
	
	@Override
	public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException,
			ServletException {
		doGet(request, response);		
	}

}
